/*
 * Common Definition
 *
 * Copyright (c) Huawei Technologies Co., Ltd. 2022. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */
#ifndef ENCLAVE_COMM_H
#define ENCLAVE_COMM_H

enum cms_errcode {
    CMS_SUCCESS = 0,
    CMS_INTERNAL_ERR = 41,
    CMS_BUFF_SMALL = 42,
    CMS_SYMMKEY_ERR = 43,
    CMS_DECRYPT_ERR = 44,
    CMS_INVALID_ARGUMENT = 45,
    CMS_RESP_ERR = 46,
    CMS_ENVELOPE_VER_ERR = 47,
    CMS_RECIP_VER_ERR = 48,
    CMS_RECIP_ALG_ERR = 49,
    CMS_CONTENT_TYPE_ERR = 50,
    CMS_CONTENT_ALGO_ERR = 51,
    CMS_CONTENT_IV_ERR = 52,
    CMS_CONTENT_CIPHER_ERR = 53,
};

struct stream_buf {
    size_t capacity;
    size_t len;
    u_char *buffer;
};

#endif
